package net.tngou.tpage.util;

import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import org.apache.commons.lang3.math.NumberUtils;





public class StringUtil extends org.apache.commons.lang3.StringUtils  {

	
	/**
	 * 
	* @Description: 替换空格 ，半角 、全角
	 */
	 public static String ReplaceBlank(String str) {
		    if (str==null)return str;
	         Pattern p = Pattern.compile("\\s*|\t|\r|\n");
	         Matcher m = p.matcher(str);
	         str = m.replaceAll("");  
		    str= remove(str, "　");
	        str=remove(str, " ");	
	        return str;
	    }
	 /**
	  * 字符串数组 转为 Long数组
	  * @param sts
	  * @return
	  */
	 public static Long[] StringToLong(String[]  sts) {
			List<Long> list = new ArrayList<>();
			for (String s : sts) {
				if(NumberUtils.isNumber(s))
					list.add(Long.parseLong(s));
			}
			return list.toArray(new Long[list.size()]);
		}
}
